3D rendering and masking